﻿using System.Windows.Controls;
using System.Resources;

namespace MemoryGames
{
    /// <summary>
    /// Interaction logic for GameStartButton.xaml
    /// </summary>
    public partial class GameStartButton : UserControl
    {
        #region "Events/Delegates"
		public delegate void GameSelectedDelegate(GameType game);
        public event GameSelectedDelegate GameSelected;
        #endregion
        
        #region "Constructors"
		public GameStartButton(GameType game)
        {
            InitializeComponent();
            this.Game = game;
            this.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(GameStartButton_MouseLeftButtonDown);
            //ResXResourceReader rsxr = new ResXResourceReader("items.resx");

        }

        #endregion

        #region "Member Variables"
        private string _text;
        #endregion

        #region " Properties "
        public string Text
        {
            get {return _text; }
            set 
            {
                _text = value;
                GameName.Content = _text;
            }
        }
        /// <summary>
        /// The game which this button starts
        /// </summary>
		public GameType Game { get; set; }
        #endregion

        #region "EventHandlers"
        void GameStartButton_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            this.GameSelected.Invoke(this.Game);
        }
        #endregion
    }

    public enum GameType
    {   WrongWord
        ,   WrongWordMaintenance
        ,   SearchDifferences
        ,   SearchDifferencesMaintenance
        ,	Memory
		,	MemoryMaintenance
    }
}
